﻿using System;
using System.Collections.Generic;
using System.IO;
using System.ServiceModel;
using System.ServiceModel.Web;

namespace SsoaFramework.Core.Other
{
    [ServiceContract(CallbackContract = typeof(IServiceBusClient))]
    internal interface IExposeServiceBus
    {
        [OperationContract(IsOneWay = true)]
        void EstablishConnection();

        [OperationContract]
        IEnumerable<Service> GetServices();

        [OperationContract]
        IEnumerable<Service> GetAllServices();

        [OperationContract]
        IEnumerable<Service> GetRoutedServices();

        [OperationContract]
        void RouteService(Service service);

        [OperationContract]
        void UnRouteService(Service service);

        [OperationContract]
        void ChangeRoute(Service service, string path);

        [OperationContract]
        Service GetService(Uri serviceAddress);
    }

    [ServiceContract]
    public interface IServiceBusClient
    {
        [OperationContract(IsOneWay = true)]
        void ServiceAppeared(Service service);
        [OperationContract(IsOneWay = true)]
        void ServiceDisappeared(Service service);
    }
}
